package com.ymttest.database.mongo;

import java.util.ArrayList;
import java.util.Map;

import com.ymt.database.MongoDBDriver;

public class YmtBuyerOrdersWrapper {

	private MongoDBDriver mdd = YmtMongoDriverFactroy.getInstance_BuyerOrdersDBdriverNew("FirstPaidOrder");
	
	@SuppressWarnings("rawtypes")
	public ArrayList<Map> getByUserId(long userId) throws Exception {
		ArrayList<Map> list = mdd.selectPartLimitToMap("{\"_id\":" + userId + "}", 1);
	    
	    return list;
	}
	
	public static void main(String[] args) throws Exception {
	
		YmtBuyerOrdersWrapper wrapper = new YmtBuyerOrdersWrapper();
		
		System.out.println(wrapper.getByUserId(20238699).get(0).get("PaidTime"));
		
	}
}
